<?php $title = 'title_'.$this->lang; ?>
<div id="right-800">
	<div id="navigator">
		<?=html::anchor('bookstore', Kohana::lang('site.bookstore').($this->lang!='cn' ? ' ' : '').Kohana::lang('site.home'))?>
		<?php 
			foreach($navigator as $category) 
			{
				echo ' -> ';
				echo html::anchor('bookstore/category/'.$category->id.'/1', $category->$title);
			}
		?>
	</div>
	<?php if(count($featured)>0 and $this->pagination->current_page == 1) { ?>
	<div class="box-h1">
		<h1><?=Kohana::lang('site.featured')?></h1>
		<div class="box1">
			<ul class="book-list">
			<?php $i=1; $p=1; foreach($featured as $product) { ?>
			<li>
				<?=html::anchor('bookstore/product/'.$product->category_id.'/'.$product->id, html::image(($product->photo_ext != '') ? 'photo/product/120/120/'.$product->id.'.'.$product->photo_ext : 'photo/product/120/120/nocover.jpg'))?>
				<h3><?=html::anchor('bookstore/product/'.$product->category_id.'/'.$product->id, $product->$title)?></h3>
				<h4>$<?=$product->price?></h4>
			</li>
				<?php if( $i % 4 == 0 and $i != count($featured) ) { $p++; ?>
					</ul><hr/><ul class="book-list">
				<?php } ?>
			<?php $i++; } ?>
			</ul>
			<?=((($i-1) % 4 != 0) and $i>$p*4) ? '<hr/>' : '<div style="clear:both;"></div>'?>
		</div>
	</div>
	<div style="height:20px;"></div>
	<?php } ?>
	<div class="box-h1">
		<h1 title="Related Books"><?=Kohana::lang('title.booksinfo')?></h1>
		<div class="box1">
			<ul class="book-list">
			<?php $i=1; foreach($products as $product) { ?>
			<li>
				<?=html::anchor('bookstore/product/'.$product->category_id.'/'.$product->id, html::image(($product->photo_ext != '') ? 'photo/product/120/120/'.$product->id.'.'.$product->photo_ext : 'photo/product/120/120/nocover.jpg'))?>
				<h3><?=html::anchor('bookstore/product/'.$product->category_id.'/'.$product->id, $product->$title)?></h3>
				<h4>$<?=$product->price?></h4>
			</li>
				<?php if( $i % 4 == 0 ) { ?>
					</ul><hr/><ul class="book-list">
				<?php } ?>
			<?php $i++; } ?>
			</ul>
			<?=($i-1) % 4 != 0 ? '<hr/>' : ''?>
			<?=$this->pagination?>
		</div>
	</div>
</div>